package com.han.spring.core.custom_bean_nature;

import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.context.Lifecycle;
import org.springframework.context.LifecycleProcessor;

/**
* @author hanpeng
* @version 创建时间：2020年7月7日 下午7:54:49
* @ClassName 类名称
* @Description 类描述
*/
public class LifecycleCallbackBean implements InitializingBean,DisposableBean,LifecycleProcessor {
	private String name;
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Override
	public void destroy() throws Exception {
		System.out.println("destroy");
		
	}

	@Override
	public void afterPropertiesSet() throws Exception {
		System.out.println("afterPropertiesSet");
	}

	@Override
	public void start() {
		System.out.println("容器开启");		
	}

	@Override
	public void stop() {
		System.out.println("容器停止");
		
	}

	@Override
	public boolean isRunning() {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public void onRefresh() {
		System.out.println("sdfsdf");
		start();
	}

	@Override
	public void onClose() {
		System.out.println("sdfsdf");
		start();
	}

}
